<template>
    <div>
        <el-bread></el-bread>
        <el-button type="primary" plain class="btn" @click="add">添加</el-button>
        <v-list @edit="edit"></v-list>
        <v-dialog :isShow="isShow" :isAdd="isAdd" @close="close" ref="dialogRef"></v-dialog>
    </div>
</template>
<script lang="ts" setup>
import { ref } from "vue"
import vList from "./list.vue"
import vDialog from "./dialog.vue"
let dialogRef =ref()

let isShow = ref(false)
let isAdd  = ref(true)
let add = () => {
     isAdd.value = true
     isShow.value = true

}
let close = () =>{
    isShow.value = false
}
let edit = (id:number) =>{
     isShow.value = true
     isAdd.value = false
     dialogRef.value.lookup(id)


}
</script>
<style lang="less" scoped>
.btn {
    margin: 10px;
    margin-left: 0;
}
</style>